package Task2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-12
 * Time:13:20
 */
public class HourlyEmployee extends ColaEmployee{
    public int salary;
    public int time;

    public HourlyEmployee(String name, int birthday, int salary, int time) {
        super(name, birthday);
        this.salary = salary;
        this.time = time;
    }

    @Override
    public double getSalary(int month) {
        if(month==super.birthday){
            if(this.time>160){
                return ((160*this.salary+(this.time-160)*this.salary*1.5)+100);
            }else {
                return (this.time*this.salary)+100;
            }
        }else{
            if(this.time>160){
                return ((160*this.salary+(this.time-160)*this.salary*1.5));
            }else {
                return (this.time*this.salary);
            }
        }
    }
}
